import request from '@/utils/request';

/**
 * 考试列表
 * @returns {Promise<*>}
 */
export async function getExamList(params) {
  return request('/admin/examinations',{params});
}

/**
 * 添加考试
 * @returns {Promise<*>}
 * @param data
 */
export async function addExam(data) {
  console.log(data)
  return request('/admin/examinations', {
    method: 'POST',
    data
  });
}


/**
 * 修改考试
 */
export async function editExam(id,params){
  return request(`/admin/examinations/${id}`,{
    method: 'PUT',
    data: params
  })
}
/**
 * 删除考试
 * @param id
 */
export async function delExam(id){
  return request.delete(`/admin/examinations/${id}`)
}

/**
 * 考试详情
 * @param id
 */
export async function detailsExam(id){
  return request(`/admin/examinations/${id}`)
}

/**
 * 部门人员列表
 * @param id
 */
export async function sections(id){
  return request(`/admin/sections/list/${id}`)
}